<template>
  <div class="not-found"> </div>
</template>

<script lang="ts">
import { defineComponent, onMounted, onUnmounted, reactive, toRefs, watch, nextTick } from 'vue';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
import Cookies from '../../utils/cookie';

export default defineComponent({
  props: {},
  components: {},
  setup () { // props, { emit }
    const router = useRouter();
    const store = useStore();
    const data = reactive({

    });

    onMounted(() => {
      nextTick(() => {
        if (window.location.hash == '#/%5B%5D') {
          const token = Cookies.get('Authorization');
          const page = token ? store.state.activePage : 'home';
          router.replace({ name: page });
        }
      });
    });

    onUnmounted(() => { });

    watch(() => { }, () => { });

    return {
      ...toRefs(data)
    };
  }
});
</script>
